package com.tedu.jsd2407_ivos_fzj.audit.controller;

import com.tedu.jsd2407_ivos_fzj.audit.pojo.dto.AuditQuery;
import com.tedu.jsd2407_ivos_fzj.audit.pojo.dto.AuditSaveParam;
import com.tedu.jsd2407_ivos_fzj.audit.pojo.vo.AuditVO;
import com.tedu.jsd2407_ivos_fzj.audit.service.AuditService;
import com.tedu.jsd2407_ivos_fzj.base.response.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/v1/audit")
@RestController
@Slf4j
public class AuditController {
    @Autowired
    private AuditService auditService;

    @GetMapping("select")
    public JsonResult selectAudit(AuditQuery auditQuery){
        log.debug("审批单查询，参数：{}",auditQuery);
        List<AuditVO> auditVOList =  auditService.selectAudit(auditQuery);
        return JsonResult.ok(auditVOList);
    }
    @PostMapping("update")
    public JsonResult update(AuditSaveParam auditSaveParam){
        auditService.saveAudit(auditSaveParam);
        return JsonResult.ok();
    }
}
